package gstyle.font;

import gstyle.Style;
import gstyle.item.Unit;

public class Font {

    private static final String SANS_SERIF_FAMILIES = "arial, verdana, tahoma";
    private String family;
    private String fontSize;
    private String weight;

    public Font(String family) {
        this.family = family;
    }

    public Style applyTo(Style style) {
        style.fontSize(fontSize);
        style.fontFamily(family);
        style.fontWeight(weight);
        return style;
    }

    public Font size(String size) {
        this.fontSize = size;
        return this;
    }
    
    public Font weight(String weight) {
        this.weight = weight;
        return this;
    }

    public Font size(Unit unit) {
        return size(unit.css());
    }

    public static Font sansSerif() {
        return new Font(SANS_SERIF_FAMILIES);
    }
}
